<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<title>完善信息个人信息</title>
	<link rel="stylesheet" href="/css/index.css">

	<link href="/css/bootstrap.min.css" rel="stylesheet">
	<link href="/css/materialdesignicons.min.css" rel="stylesheet">
	<link href="/css/style.min.css" rel="stylesheet">

</head>
<body class="body">
<div th:insert="~{navigation :: copy}"></div>
<div class="container">
<div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="card-body">

				<form action="/stu/SaveStu" method="post" class="row" enctype="multipart/form-data">
					<input type="hidden" name="userId" th:value="${stu.userId}">
					<div class="form-group col-md-3">
						<label for="departId">院系</label>
						<div class="form-controls">
							<span th:text="${stu.tbDepart.departName}"></span>
							<input type="hidden" name="departId" id="departId" th:value="${stu.departId}">
						</div>
					</div>

					<div class="form-group col-md-3">
						<label for="specId">专业</label>
						<div class="form-controls">
							<span th:text="${stu.tbSpec.specname}"></span>
							<input type="hidden" name="specId" id="specId" th:value="${stu.specId}">
						</div>
					</div>

					<div class="form-group col-md-3">
						<label for="classId">班级</label>
						<div class="form-controls">
							<span th:text="${stu.tbClass.className}"></span>
							<input type="hidden" name="classId" id="classId" th:value="${stu.classId}">
						</div>
					</div>
					<div class="form-group col-md-12"></div>
					<div class="form-group col-md-3">
						<label for="name">姓名</label>
						<input type="text" class="form-control" id="name" name="name" th:value="${stu.name}" placeholder="请输入姓名" />
					</div>
					<div class="form-group">
						<label class="col-xs-12" for="stuImg">上传头像</label>
						<div class="col-xs-12">
							<input type="hidden" name="stuImg" th:value="${stu.stuImg}">
							<img class="img-avatar img-avatar-48 m-r-10" th:src="${stu.stuImg}" th:alt="头像" />
							<input type="file" accept="image/jpg,image/png,image/gif" id="stuImg" name="file" onchange="fileChange(this)">
						</div>
					</div>
					<div class="form-group col-md-12"></div>
					<div class="form-group col-md-3">
						<label>性别</label>
						<div class="clearfix">
							<label class="lyear-radio radio-inline radio-primary">
								<input type="radio" name="sex" value="男" th:checked="${stu.sex=='男'}"><span>男</span>
							</label>
							<label class="lyear-radio radio-inline radio-primary">
								<input type="radio" name="sex" value="女" th:checked="${stu.sex=='女'}"><span>女</span>
							</label>
						</div>
					</div>

					<div class="form-group col-md-12"></div>
					<div class="form-group col-md-3">
						<label for="mobile">手机</label>
						<input type="text" class="form-control" id="mobile" name="mobile" th:value="${stu.mobile}" placeholder="请输入手机号" />
					</div>

					<div class="form-group col-md-12"></div>
					<div class="form-group col-md-3">
						<label for="email">email</label>
						<input type="text" class="form-control" id="email" name="email" th:value="${stu.email}" placeholder="请输入邮箱" />
					</div>

					<div class="form-group col-md-12"></div>
					<div class="form-group col-md-3">
						<label for="job">工作信息</label>
						<input type="text" class="form-control" id="job" name="job" th:value="${stu.job}" placeholder="" />
					</div>
					<div class="form-group col-md-12"></div>
					<div class="form-group col-md-3">
						<label for="address">地址</label>
						<input type="text" class="form-control" id="address" name="address" th:value="${stu.address}" placeholder="" />
					</div>

					<div class="form-group col-md-12">
						<button type="submit" class="btn btn-primary ajax-post" target-form="add-form">保存</button>
						<button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
					</div>
				</form>

			</div>
		</div>
	</div>
</div>
</div>

<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<script type="text/javascript" src="/js/axios.min.js"></script>
<script type="text/javascript">
    function fileChange(target) {
        var fileSize = 0;
        fileSize = target.files[0].size;
        var size = fileSize / 1024;
        if (size > 1000) {
            alert("附件不能大于1M");
            target.value = "";
            return false;   //阻止submit提交
        }
        var name = target.value;
        var fileName = name.substring(name.lastIndexOf(".") + 1).toLowerCase();
        if (fileName != "jpg" && fileName != "png"&&fileName!="gif"&&fileName!="jpeg") {
            alert("请选择图片格式文件上传(jpg、png、gif)！");
            target.value = "";
            return false;   //阻止submit提交
        }
    }

</script>
</body>
</html>